package com.sg.controller.bff;

import com.sg.service.biz.bff.StationService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "Station", tags = {"Station"})
@RestController
// @RequestMapping("/oms/station/")
public class StationController {

    @Autowired
    StationService stationService;

    /**
     * B1-3查询岗位列表（管理）
     * gen by moon at 8/10/2022, 3:33:59 AM
     */
    @PostMapping("/oms/mgt/station/queryStationList")
    @ApiOperation(value = "B1-3查询岗位列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryStationListRespDto> queryStationList(@RequestBody(required = false) @Validated BffQueryStationListReqDto reqDTO) {
        return OkrResult.success(stationService.queryStationList(reqDTO));
    }

    /**
     * B1-3查询编制去重岗位列表（边界）
     * gen by moon at 8/10/2022, 3:37:30 AM
     */
    @PostMapping("/oms/mgt/station/queryNoRepStationList")
    @ApiOperation(value = "B1-3查询编制去重岗位列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryNoRepStationListRespDto> queryNoRepStationList(@RequestBody(required = false) @Validated BffQueryNoRepStationListReqDto reqDTO) {
        return OkrResult.success(stationService.queryNoRepStationList(reqDTO));
    }

    /**
     * B1-3查询可存档职位条件判断（管理）
     * gen by moon at 8/10/2022, 3:36:36 AM
     */
    @PostMapping("/oms/mgt/station/queryArchivePost")
    @ApiOperation(value = "B1-3查询可存档职位条件判断（管理）", response = OkrResult.class)
    public OkrResult<BffQueryArchivePostRespDto> queryArchivePost(@RequestBody(required = false) @Validated BffQueryArchivePostReqDto reqDTO) {
        return OkrResult.success(stationService.queryArchivePost(reqDTO));
    }

    /**
     * B-13新增岗位（管理）
     * gen by moon at 8/10/2022, 3:36:34 AM
     */
    @PostMapping("/oms/mgt/station/addStation")
    @ApiOperation(value = "B-13新增岗位（管理）", response = OkrResult.class)
    public OkrResult<BffAddStationRespDto> addStation(@RequestBody(required = false) @Validated BffAddStationReqDto reqDTO) {
        return OkrResult.success(stationService.addStation(reqDTO));
    }

    /**
     * B1-3查询可存档岗位条件判断（管理）
     * gen by moon at 8/10/2022, 3:36:33 AM
     */
    @PostMapping("/oms/mgt/station/queryArchiveStation")
    @ApiOperation(value = "B1-3查询可存档岗位条件判断（管理）", response = OkrResult.class)
    public OkrResult<BffQueryArchiveStationRespDto> queryArchiveStation(@RequestBody(required = false) @Validated BffQueryArchiveStationReqDto reqDTO) {
        return OkrResult.success(stationService.queryArchiveStation(reqDTO));
    }

    /**
     * B1-3查询岗位列表（边界）
     * gen by moon at 8/10/2022, 3:35:28 AM
     */
    @PostMapping("/oms/mgt/station/queryStationListBorder")
    @ApiOperation(value = "B1-3查询岗位列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryStationListBorderRespDto> queryStationListBorder(@RequestBody(required = false) @Validated BffQueryStationListBorderReqDto reqDTO) {
        return OkrResult.success(stationService.queryStationListBorder(reqDTO));
    }

    /**
     * B1-3修改职位（管理）
     * gen by moon at 8/10/2022, 3:34:18 AM
     */
    @PostMapping("/oms/mgt/station/updatePost")
    @ApiOperation(value = "B1-3修改职位（管理）", response = OkrResult.class)
    public OkrResult<BffUpdatePostRespDto> updatePost(@RequestBody(required = false) @Validated BffUpdatePostReqDto reqDTO) {
        return OkrResult.success(stationService.updatePost(reqDTO));
    }

    /**
     * B1-3新增职位（管理）
     * gen by moon at 8/10/2022, 3:34:17 AM
     */
    @PostMapping("/oms/mgt/station/addPost")
    @ApiOperation(value = "B1-3新增职位（管理）", response = OkrResult.class)
    public OkrResult<BffAddPostRespDto> addPost(@RequestBody(required = false) @Validated BffAddPostReqDto reqDTO) {
        return OkrResult.success(stationService.addPost(reqDTO));
    }

    /**
     * B1-3查询职位详情（管理）
     * gen by moon at 8/10/2022, 3:34:15 AM
     */
    @PostMapping("/oms/mgt/station/queryPostDetail")
    @ApiOperation(value = "B1-3查询职位详情（管理）", response = OkrResult.class)
    public OkrResult<BffQueryPostDetailRespDto> queryPostDetail(@RequestBody(required = false) @Validated BffQueryPostDetailReqDto reqDTO) {
        return OkrResult.success(stationService.queryPostDetail(reqDTO));
    }

    /**
     * B1-3查询职位列表（管理）
     * gen by moon at 8/10/2022, 3:34:14 AM
     */
    @PostMapping("/oms/mgt/station/queryPostList")
    @ApiOperation(value = "B1-3查询职位列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryPostListRespDto> queryPostList(@RequestBody(required = false) @Validated BffQueryPostListReqDto reqDTO) {
        return OkrResult.success(stationService.queryPostList(reqDTO));
    }

    /**
     * B1-3存档岗位（管理）
     */
    @PostMapping("/oms/mgt/station/archiveStation")
    @ApiOperation(value = "B1-3存档岗位（管理）", response = OkrResult.class)
    public OkrResult<BffArchiveStationRespDto> archiveStation(@RequestBody(required = false) @Validated BffArchiveStationReqDto reqDTO) {
        return OkrResult.success(stationService.archiveStation(reqDTO));
    }

    /**
     * B1-3查询职位列表（边界）
     * gen by moon at 8/10/2022, 3:34:13 AM
     */
    @PostMapping("/oms/mgt/station/queryPostListBorder")
    @ApiOperation(value = "B1-3查询职位列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryPostListBorderRespDto> queryPostListBorder(@RequestBody(required = false) @Validated BffQueryPostListBorderReqDto reqDTO) {
        return OkrResult.success(stationService.queryPostListBorder(reqDTO));
    }

    /**
     * B1-3修改岗位（管理）
     * gen by moon at 8/10/2022, 3:34:07 AM
     */
    @PostMapping("/oms/mgt/station/updateStation")
    @ApiOperation(value = "B1-3修改岗位（管理）", response = OkrResult.class)
    public OkrResult<BffUpdateStationRespDto> updateStation(@RequestBody(required = false) @Validated BffUpdateStationReqDto reqDTO) {
        return OkrResult.success(stationService.updateStation(reqDTO));
    }

    /**
     * B1-3查询岗位详情（管理）
     * gen by moon at 8/10/2022, 3:34:06 AM
     */
    @PostMapping("/oms/mgt/station/queryStationDetail")
    @ApiOperation(value = "B1-3查询岗位详情（管理）", response = OkrResult.class)
    public OkrResult<BffQueryStationDetailRespDto> queryStationDetail(@RequestBody(required = false) @Validated BffQueryStationDetailReqDto reqDTO) {
        return OkrResult.success(stationService.queryStationDetail(reqDTO));
    }
}
